﻿@{
    Layout = "~/Views/Shared/_Layout_Admin.cshtml";
    ViewBag.Title = "播放列表管理";
}
@section UsingFile{
    @ViewHelper.Css("/css/admin/playlist.css")
}
<h2 style="float: right;">
    <a href="/playlist/modify">添加</a>
</h2>
<div class="clearall"></div>
<div class="player_list">
    @PlayerUrls(ViewBag.List ?? null)
</div>
@helper PlayerUrls(List<Html5Music.Model.PlayList> list)
{
    if (list == null)
    {
        return;
    }
    
    <text>
    <ul>
        @{
            foreach (var item in list)
            {
                string url = string.Format("/player/{0}", item.Key);
                string modify_url = string.Format("/playlist/modify?guid={0}", item.ID);
        
            <text>
            <li>
                <i class="playlist_item">
                    <a href="@(url)" target="_blank">@(item.Title)</a>
                </i>
                <i class="modify">
                    <a href="@(modify_url)">修改</a>
                </i>
            </li>
            </text>
            }
        }
    </ul>
    <div class="clearall"></div>
    </text>
}